﻿//#define BLACK

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Silvermoon.Windows.Styles;
using Silvermoon.Windows;
using Silvermoon.Controls;
using OutlookHub.Utils;
using System.Drawing;
using Silvermoon.Shapes;
using Silvermoon.Controls.Forms;

namespace OutlookHub.Styles
{
    public static class StylePool
    {
        public static readonly StyleDictionary Outlook;
        public static readonly StyleDictionary EMails;
        public static readonly StyleDictionary Details = new MetroStyles();
        public static readonly StyleDictionary EmailDetails = new MetroStyles();
        public static readonly StyleDictionary TaskDetails = new MetroStyles();

        static StylePool()
        {
            Outlook = new MetroStyles();
            Outlook.SetClass<TextItem>(new TextItemStyle { Font = FontPool.MediumRegularFont });

            EMails = new MetroStyles();
            EMails.SetNamed(new LabelStyle { Name = TabPage.LabelStyleName, Font = FontPool.BigRegularFont, FontScale = 1.5f });
            Details.SetNamed(new LabelStyle { Name = TabPage.LabelStyleName, Font = FontPool.BigRegularFont, FontScale = 1.5f });
            Details.SetClass<TitleDetailsImageItem>(new TitleDetailsImageItemStyle { TitleFont = FontPool.MediumRegularFont, DetailsFont = FontPool.MediumRegularFont });
            EMails.SetClass<TabControl>(new TabControlStyle { UnselectedTextColor = PhoneColors.FromArgb(128, 0, 0, 0) });
            EmailDetails.SetNamed(new LabelStyle { Name = TabPage.LabelStyleName, Font = FontPool.BigRegularFont, FontScale = 1.5f });

#if BLACK
            EmailDetails.SetClass<TextBox>(new Style { Color = Color.Transparent, Chrome = Shape.Empty, TextColor = Color.White });
            EmailDetails.SetClass<ScrollViewer>(new ScrollViewerStyle { ScrollbarColor = PhoneColors.White });
#else
            EMails.SetClass<Page>(new WindowStyle { Background = PhoneColors.White, TextColor = PhoneColors.Black, ToolbarBackground =Color.Gainsboro, ToolbarTextColor = PhoneColors.Black });
            EMails.SetClass<Toolbar>(new Style { TextColor = PhoneColors.Black });
            EMails.SetClass<ScrollViewer>(new ScrollViewerStyle { ScrollbarColor = PhoneColors.Black });

            EmailDetails.SetClass<ScrollViewer>(new ScrollViewerStyle { ScrollbarColor = PhoneColors.Black });
            EmailDetails.SetClass<Page>(new WindowStyle { Background = PhoneColors.White, TextColor = PhoneColors.Black, ToolbarBackground = Color.Gainsboro, ToolbarTextColor = PhoneColors.Black });
            EmailDetails.SetClass<Toolbar>(new Style { TextColor = PhoneColors.Black });
            EmailDetails.SetClass<TitleDetailsImageItem>(new TitleDetailsImageItemStyle { TitleFont = FontPool.MediumRegularFont, DetailsFont = FontPool.MediumRegularFont });
            EMails.SetClass<MessageDialog>(new FormStyle { Background = PhoneColors.Light, Chrome = new BorderShape { BorderSize = 2, Color = PhoneColors.Medium }, Color = PhoneColors.White, TextColor = PhoneColors.Black, TransitionManager = TransitionManagers.DialogTransitionManager, ForceTextColor = true });
            EMails.SetClass<DialogButton>(new Style { TextColor = PhoneColors.Black, Background = Shape.Empty, Chrome = new BorderShape { BorderSize = 4, Color = PhoneColors.Black } });
#endif
            //TaskDetails.SetNamed(new LabelStyle { Name = TabPage.LabelStyleName, Font = FontPool.BigRegularFont, FontScale = 1.5f });
            TaskDetails.SetClass<TextItem>(new TextItemStyle { Font = FontPool.MediumRegularFont });
            TaskDetails.SetClass<TitleDetailsImageItem>(new TitleDetailsImageItemStyle { TitleFont = FontPool.MediumRegularFont });
            TaskDetails.SetClass<TextBox>(new TextBoxStyle { Font = FontPool.MediumRegularFont, Chrome = new BorderShape { Color = Color.Black, BorderSize = 3 }, Background = PhoneColors.White });
            TaskDetails.SetNamed(new ButtonStyle
            {
                Name = "Picker",
                StateManager = ButtonStateManagers.PickerManager,
                Background = PhoneColors.Light,
                Color = PhoneColors.Light,
                TextColor = PhoneColors.Black,
                Padding = new Margin(20, 4, null, 20),
                Font = FontPool.MediumRegularFont,
                Chrome = new BorderShape { BorderSize = 3, Color = PhoneColors.White }
            });
        }


    }
}

